/* eslint-disable max-classes-per-file */
/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2023-08-16 17:36:20
 * @LastEditors: wiz
 * @LastEditTime: 2023-12-16 11:17:28
 */
import { N_oSetupPanel } from '../../types';
import { T_compPanelConf } from '../compConfPanel';
// import { T_toolbarLib } from '../compToolbar';
import { T_compBase } from './compBase';

type I_tableStyle = N_oSetupPanel.N_comps.I_tableStyle;
// type I_compToolbar = N_oSetupPanel.N_comps.I_compToolbar;
type I_messageConf = N_oSetupPanel.N_comps.I_messageConf;
type I_fieldCountRule = N_oSetupPanel.N_comps.I_fieldCountRule;
export class T_dateNavConf {
  name: string;

  comment: string;

  isCreated: boolean;

  status: string;

  dateType: string; // 'day','week','year'

  statisticsFields: I_fieldCountRule[];

  messageConfig: I_messageConf;
}

export class T_dateNav extends T_compBase {
  private TcompPanelConf: T_compPanelConf = new T_compPanelConf();

  // private TtoolbarLib: T_toolbarLib = new T_toolbarLib();

  public conf: T_dateNavConf = new T_dateNavConf();

  constructor() {
    super();
    this.conf = {
      name: '',
      comment: '',
      isCreated: false,
      status: '',
      dateType: '',
      statisticsFields: [],

      messageConfig: {
        custDefListener: {
          search: [],
          coordination: null
        },
        emitActions: {
          search: [],
          refresh: []
        },
        eventGroup: null
      }
    };
  }

  public getPermissionList(): Array<N_oSetupPanel.I_permission> {
    return [];
  }

  public getComponentId(): N_oSetupPanel.N_comps.COMP_MODULE_ID {
    return N_oSetupPanel.N_comps.COMP_MODULE_ID.DATE_NAV;
  }

  public getConf(): T_dateNavConf {
    return this.conf;
  }

  public GetCompPanelConf(): N_oSetupPanel.N_comps.I_setupPanel {
    return this.TcompPanelConf.getCompPanelSet(
      N_oSetupPanel.N_comps.COMP_NAME.DATE_NAV
    );
  }
}
